public class DaveQueue {

	
	Node head;
	Node tail;
	Node temp;
	
	
	public DaveQueue()
	{
		head = null;
		temp = null;
		tail = null;
	}
	
	public void push(int value)
	{
		if(head == null && tail == null )//empty list
		{
			head = new Node(value);
			
			
			
			
		}
		else if (head !=null && tail == null)
		{
			
			tail = new Node(value);
			head.setNext(tail);
			
		}
		
		else if (head !=null && tail != null)
		{
			temp = new Node(value);
			tail.setNext(temp);
			tail = temp;
		}
		
		else 
		{
			head = tail;
			tail = null;
			
		}
	}
	
	public int front()
	{
		return head.getItem();		
	}

	public int  pop()
	{
		
		
	int result = head.getItem();
	
	 head = head.getNext();
	 
	 return result;
		
		
	}
	
	public int size()
	{
		int count=0;
		for(temp = head; temp!= null; temp=temp.getNext())
		{
			count++;
		}
		return count;
	}
	
	public boolean empty()
	{
		return (head==null);
	}
	

	
	
	

}
